import time
import math
WIDTH = 800
HEIGHT = 800

BACK_COLOR = (0, 0, 0)

FPS = ""
lastUpdateTime = 0
lastTime = 0

def update():
    global FPS
    global lastTime, lastUpdateTime
    
    accumTime = time.time() - lastUpdateTime
    t = time.time() - lastTime
    lastTime = time.time()
    if accumTime > 1:
        FPS = "FPS:" + str(math.floor(1 / t))
        lastUpdateTime = time.time()
def draw():
    screen.clear()
    screen.fill(BACK_COLOR)

    screen.draw.text(FPS, topleft = (0, 0))